#include "Comm.hpp"
#include"pipe.hpp"
int main()
{
    key_t key = Getkey();//获取key
    int shmid = ClientGetshm(key);//获取共享内存
    void *addr = Attach(shmid);//挂接
    int *address = (int *)addr;
   int wfd= clientopenfifo();//以写方式打开文件
    for (int i = 0; i < 10; i++)
    {
        *(address + i) = i + 1;
        wakeup(wfd);//写完了一部分完整的数据就通知唤醒读端
        sleep(1);
    }
    Detach(addr);//去挂接
    return 0;
}